/**
 * 
 */
package com.maohi.software.arii.annotations;

import java.lang.annotation.Annotation;

/**
 * @author heifara
 * 
 */
public final class JaxBImpl implements JaxB {

	public static JaxBImpl jaxb(String iId) {
		return new JaxBImpl(iId);
	}

	private final String value;

	public JaxBImpl(String aId) {
		this.value = aId;
	}

	@Override
	public Class<? extends Annotation> annotationType() {
		return JaxB.class;
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof JaxB)) {
			return false;
		}

		JaxB other = (JaxB) obj;
		return this.value.equals(other.value());
	}

	@Override
	public int hashCode() {
		// This is specified in java.lang.Annotation.
		return (127 * "value".hashCode()) ^ this.value.hashCode();
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("JaxBImpl [value=");
		builder.append(this.value);
		builder.append("]");
		return builder.toString();
	}

	@Override
	public String value() {
		return this.value;
	}

}
